Skip to content

feat(custom): Commission Engine reliability + security rules from the V1 build#4

Closed
TiguniaOG wants to merge 2 commits into
mainfrom
custom/commission-engine-reliability-knowledge
Closed

feat(custom): Commission Engine reliability + security rules from the V1 build#4
TiguniaOG wants to merge 2 commits into
mainfrom
custom/commission-engine-reliability-knowledge

Conversation

@TiguniaOG

@TiguniaOG TiguniaOG commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Adds 9 org-specific AL coding rules to the custom/ layer, each surfaced and verified during the CommissionCentral V1 Commission Engine build (commissions-management epic microsoft#51, follow-up #84). Every rule encodes a BC-specific defect we actually hit and fixed, with a .good.al / .bad.al sample pair. All atomic, ≤30 lines, no fenced code, 6/6 frontmatter fields; all 9 index cleanly (Build-KnowledgeIndex.ps1 → 167 articles, 0 parse errors).

Two commits: the first seeded 5 reliability rules; the second adds 4 more (3 reliability + 1 security) to complete the batch.

Reliability (8)

  • rolling-period-window-must-be-trailing-not-forward — a rolling-period DateFormula must apply the period as a trailing offset (negate / step back); a positive 1M applied forward lands in the future and empties the window. (Cap-period blocker, PR #80.)
  • re-derive-dependent-fields-after-a-record-mutation-event — re-derive dependent amounts (e.g. net payable) after a mutate-the-record extension event; a hook firing after the derivation leaves the dependent field stale. (PR #80.)
  • match-return-to-source-via-item-application-not-order-link — match a return/credit memo to its shipment via the item application (Appl.-from Item Entry → ILE Document No.), not Sales Cr.Memo Line."Order No." (blank on a return-order-sourced credit memo). (ENG-8 / #59.)
  • reopen-released-sales-document-before-editing-status-open-fields — modifying a TestStatusOpen field (e.g. Unit Price) on a Released sales order errors; reopen first (Qty. to Ship/Qty. to Invoice are exempt). (ENG-8 / #59.)
  • split-allocations-reconcile-to-rounded-line-total — split allocations must reconcile to the rounded line total (largest-remainder / last-share-absorbs-residual), not round each share independently. (#71.)
  • interval-bands-must-be-contiguous-no-gaps-or-overlaps — tier/breakpoint bands must be validated for contiguity (no gaps, no overlaps) across the whole set, including on delete.
  • stage-committed-siblings-and-overlay-rec-for-set-validation-in-triggersOnInsert/OnModify can't see the in-flight Rec via a plain table scan; stage committed siblings and overlay Rec to validate the post-change set.
  • read-cust-ledger-remaining-amount-after-application-detailed-entries-post — don't read a Cust. Ledger Entry's Remaining Amount in Gen. Jnl.-Post Line.OnAfterApplyCustLedgEntry (fires before the application detailed entries post); react to Detailed Cust. Ledg. Entry.OnAfterInsertEvent (Entry Type = Application).

Security (1)

  • securityfiltering-is-not-per-user-row-isolation-or-a-permissionset-propertySecurityFiltering is not a permission-set property and does not by itself isolate rows per user; true per-user row security needs configured security filters, or isolate at the application layer. (BL-07 rep data isolation.)

Provenance

Each rule cites the originating commissions-management issue/PR in its ## See also. Sources: the engine epic microsoft#51 build and the close-out review.

🤖 Generated with Claude Code

TiguniaOG and others added 2 commits June 22, 2026 16:11
Five custom/knowledge/reliability rules, each encoding a real defect that slipped through the CommissionCentral V1 engine build (Tigunia-Apps/commissions-management#84): rolling-period window must be trailing not forward; re-derive dependent fields after a record-mutation event; match a return/credit memo to its source via item application not the order link; reopen a Released sales document before editing TestStatusOpen fields; split allocations must reconcile to the rounded line total. Each with .good.al/.bad.al samples per skills/write.md. (Four older pending rules — band integrity, OnInsert in-flight Rec staging, SecurityFiltering invalidity, CLE Remaining-Amount timing — remain for a follow-up batch.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the V1 build knowledge contribution: whole-set trigger
validation (stage committed siblings + overlay Rec), reading customer
ledger Remaining Amount after application detailed entries post,
interval/breakpoint band contiguity, and SecurityFiltering not being a
permission-set property or per-user row isolation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TiguniaOG TiguniaOG changed the title feat(custom): Commission Engine reliability knowledge rules feat(custom): Commission Engine reliability + security rules from the V1 build Jun 22, 2026
@TiguniaOG TiguniaOG closed this Jun 25, 2026
@TiguniaOG TiguniaOG deleted the custom/commission-engine-reliability-knowledge branch June 25, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant